import React from 'react';
import { message } from 'antd';
import { Row, Col, Card, Form, Input, Select, Radio, Switch, Collapse, Button, Upload, Icon, Table } from 'antd';
import { DEFAULT_PAGE_SIZE } from '../../utils/constants';
import styles from '../common.css';
import HorizontalBarChart from './HorizontalBarChart';
import VerticalBarChart from './VerticalBarChart';
import MyAreaChart from './AreaChart';
import MyLineChart from './LineChart';
import MyPieChart from './PieChart';
import StackBarEchart from './StackBarEchart';
import LineEchart from './LineEchart';

const FormItem = Form.Item;
const TextArea = Input.TextArea;
const Option = Select.Option;
const RadioGroup = Radio.Group;
const Panel = Collapse.Panel;

const formItemLayout = {
  labelCol: { span: 5 },
  wrapperCol: { span: 19 },
};
const formItemLayout1 = {
  labelCol: { span: 3.5 },
  wrapperCol: { span: 20.5 },
};

const formItemLayout2 = {
  labelCol: { span: 1.5 },
  wrapperCol: { span: 22.5  },
};
@Form.create()
export default class QuaReportModal extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      fileinfo: [],
    };
  }

   // 监听快捷键事件
    componentDidMount(){
      document.addEventListener('keyup',this.onKeyDown);
    }
    componentWillUnmount(){
      document.removeEventListener('keyup',this.onKeyDown);
    }
  // 新增质量报告，需要调用统计数据查询接口，将部分基础数据查询回来
  handleSearch = () => { 
    const {  // 该组件的属性，由外部传入参数
      dispatch,
      form: { validateFields, getFieldsValue },
    } = this.props;
    validateFields((errors) => {
      if (errors) {
        return;
      }
      const data = {
        ...getFieldsValue(),
      };
      dispatch({ // 调用接口，请求数据
        type: 'qualityreport/fetchPrjProcessData', //  models的namespace + effects的方法名，也可以是reducers的方法
        payload: {
          params: data,
        },
      });
    });
  };
  // 添加事件

  onKeyDown=(e) => {
    if(e.keyCode===13){
      this.handleSearch()
    }
  }
  // 点击OK时，提交质量分析报告结果（修改or新增）
  handleOk = () => { 
    const { dispatch, currentUser, RelatedAnalysisData,form: { validateFields, getFieldsValue } } = this.props;
    validateFields((errors) => {
      if (errors) {
        return;
      }
      let temp_bug_data= {
        Hotfix : RelatedAnalysisData?JSON.stringify(RelatedAnalysisData["Hotfix"]):[],
        // insStoryTrendArray: RelatedAnalysisData.StoryChangeTrend ? JSON.stringify(RelatedAnalysisData.StoryChangeTrend['insertstory']) : [],
        // delayStoryTrendArray :RelatedAnalysisData.StoryChangeTrend?JSON.stringify(RelatedAnalysisData.StoryChangeTrend['delaystory']) : [],
        // insStoryDetail : RelatedAnalysisData.StoryChangeDetail?JSON.stringify(RelatedAnalysisData.StoryChangeDetail['insertStory']) : [],
        // delayStoryDetail : RelatedAnalysisData.StoryChangeDetail?JSON.stringify(RelatedAnalysisData.StoryChangeDetail['delayStory']) : [],
        StoryChangeTrend: RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.StoryChangeTrend):[],
        StoryChangeDetail: RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.StoryChangeDetail):[],
        RecentVersionDensity :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.RecentVersionDensity) : [],
        DevRecentVersionDensity : RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.DevRecentVersionDensity) : [],
        WorkLoad :RelatedAnalysisData?(RelatedAnalysisData.StoryChangeTrend? JSON.stringify(RelatedAnalysisData.StoryChangeTrend.completedstory): []) : [],
        DevWorkLoad: RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.DevWorkLoad) : [], 
        ReopenBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.ReopenBug) : [], 
        PriorityBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.PriorityBug) : [], 
        LongTimeBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.LongTimeBug) : [], 
        ReasonBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.ReasonBug) : [], 
        InprogressAction :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.InprogressAction) : [], 
        WrongJira : RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.WrongJira) : []
      }
      let  adddata = {
        ...temp_bug_data,
        ...getFieldsValue(),
      };

      let editdata =
      {
        ...currentUser,
        ...getFieldsValue(),
      };

      const data = currentUser.id ? editdata : adddata;
 
      const type = `qualityreport/${data.id ? 'updateQuality' : 'addQuality'}`;// 根据是否有id
      dispatch({
        type,
        payload: {
          qa_rep_param: data,
          cb: this.handleCancel,
        },
      });
    });
  };
  handleCancel = () => {
    const { dispatch, currentUser, RelatedAnalysisData, form: { resetFields } ,onCancel} = this.props;
    // const {  form: { resetFields }, onCancel } = this.props;
    onCancel(resetFields);
    dispatch({
      type:"qualityreport/clearQuaAnalysisData",
      payload:{},
    })
  };
  handleSaveandSend = () => {
    const { dispatch, currentUser, RelatedAnalysisData, form: { validateFields, getFieldsValue } } = this.props;
    validateFields((errors) => {
      if (errors) {
        return;
      }
      let temp_bug_data= {
        Hotfix : RelatedAnalysisData?JSON.stringify(RelatedAnalysisData["Hotfix"]):[],
        StoryChangeTrend: RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.StoryChangeTrend):[],
        StoryChangeDetail: RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.StoryChangeDetail):[],
        RecentVersionDensity :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.RecentVersionDensity) : [],
        DevRecentVersionDensity : RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.DevRecentVersionDensity) : [],
        WorkLoad :  RelatedAnalysisData?(RelatedAnalysisData.StoryChangeTrend? JSON.stringify(RelatedAnalysisData.StoryChangeTrend.completedstory): []) : [],
        DevWorkLoad: RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.DevWorkLoad) : [], 
        ReopenBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.ReopenBug) : [], 
        PriorityBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.PriorityBug) : [], 
        LongTimeBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.LongTimeBug) : [], 
        ReasonBug :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.ReasonBug) : [], 
        InprogressAction :  RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.InprogressAction) : [], 
        WrongJira : RelatedAnalysisData?JSON.stringify(RelatedAnalysisData.WrongJira) : []
      }
      let  adddata = {
        ...temp_bug_data,
        ...getFieldsValue(),
      };

      let editdata =
      {
        ...currentUser,
        ...getFieldsValue(),
      };

      const data = currentUser.id ? editdata : adddata;
      const type = 'qualityreport/saveAndsendQuality';
      dispatch({
        type,
        payload: {
          sendparam: data,
          cb: this.handleCancel,
        },
      });
    });
  };

  render() {
    const { loading, ProjectList,ButtonVisible,currentUser, RelatedAnalysisData,form: { getFieldDecorator } }
      = this.props;
 
    let formdata=currentUser.id?(
      {
        Hotfix : currentUser['Hotfix'] ?JSON.parse(currentUser['Hotfix']):[],
        insStoryTrendArray : currentUser['StoryChangeTrend'] ? JSON.parse(currentUser['StoryChangeTrend'])['insertstory']:[],
        delayStoryTrendArray : currentUser['StoryChangeTrend'] ? JSON.parse(currentUser['StoryChangeTrend'])['delaystory'] : [],
        insStoryDetail : currentUser['StoryChangeDetail'] ? JSON.parse(currentUser['StoryChangeDetail'])['insertStory'] : [],
        delayStoryDetail : currentUser['StoryChangeDetail'] ? JSON.parse(currentUser['StoryChangeDetail'])['delayStory'] : [],
        recentVersionDensityArray : currentUser['RecentVersionDensity']?JSON.parse(currentUser['RecentVersionDensity']) : [],
        workLoadArray : currentUser['WorkLoad']?JSON.parse(currentUser['WorkLoad']) : [],
        DevRecentVersionDensityArray: currentUser['DevRecentVersionDensity']?JSON.parse(currentUser['DevRecentVersionDensity']) : [],
        DevWorkLoadArray : currentUser['DevWorkLoad']?JSON.parse(currentUser['DevWorkLoad']) : [],
        reoenBug : currentUser['ReopenBug']?JSON.parse(currentUser['ReopenBug']) : [],
        priorityBugArray : currentUser['PriorityBug']?JSON.parse(currentUser['PriorityBug']) : [],
        longTimeBugArray : currentUser['LongTimeBug']?JSON.parse(currentUser['LongTimeBug']) : [],
        reasonBugArray : currentUser['ReasonBug']?JSON.parse(currentUser['ReasonBug']): [],
        inprogressActionArray : currentUser['InprogressAction']?JSON.parse(currentUser['InprogressAction']) : [],
        WrongJiraArray :  currentUser['WrongJira']?JSON.parse(currentUser['WrongJira']) : [],

      }
    ) : (
      
      {
        Hotfix : RelatedAnalysisData?RelatedAnalysisData["Hotfix"]:[],
        insStoryTrendArray: RelatedAnalysisData.StoryChangeTrend ? RelatedAnalysisData.StoryChangeTrend['insertstory'] : [],
        delayStoryTrendArray :RelatedAnalysisData.StoryChangeTrend?RelatedAnalysisData.StoryChangeTrend['delaystory'] : [],
        insStoryDetail : RelatedAnalysisData.StoryChangeDetail?RelatedAnalysisData.StoryChangeDetail['insertStory'] : [],
        delayStoryDetail : RelatedAnalysisData.StoryChangeDetail?RelatedAnalysisData.StoryChangeDetail['delayStory'] : [],
        recentVersionDensityArray :  RelatedAnalysisData?RelatedAnalysisData.RecentVersionDensity : [],
        workLoadArray :  RelatedAnalysisData.StoryChangeTrend ? RelatedAnalysisData.StoryChangeTrend['completedstory'] : [],
        DevRecentVersionDensityArray:  RelatedAnalysisData?RelatedAnalysisData.DevRecentVersionDensity : [],
        DevWorkLoadArray :   RelatedAnalysisData?RelatedAnalysisData.DevWorkLoad : [],
        reoenBug :  RelatedAnalysisData?RelatedAnalysisData.ReopenBug : [], 
        priorityBugArray :  RelatedAnalysisData?RelatedAnalysisData.PriorityBug : [], 
        longTimeBugArray :  RelatedAnalysisData?RelatedAnalysisData.LongTimeBug : [], 
        reasonBugArray :  RelatedAnalysisData?RelatedAnalysisData.ReasonBug : [], 
        inprogressActionArray :  RelatedAnalysisData?RelatedAnalysisData.InprogressAction : [], 
        WrongJiraArray : RelatedAnalysisData?RelatedAnalysisData.WrongJira : []
      }
    );
    console.log("workLoadArray",formdata["workLoadArray"])
    const LineEchartObj = {
      style: { width: '100%', height: '200px' },
      originData: formdata.DevRecentVersionDensityArray,
    }

    const StackBarEchartObj = {
      style: { width: '100%', height: '500px' },
      originData: formdata.DevWorkLoadArray,
    }
    const insertStoryTrendObj = {
      style: { width: '100%', height: '140px' },
      // data: insStoryTrendArray,
      data: formdata.insStoryTrendArray,
      lines: [
        {
          name: '个数',
          color: '#98ff1a',
          dataKey: 'value',
        },
      ],
    };
    const delayStoryTrendObj = {
      style: { width: '100%', height: '140px' },
      data: formdata.delayStoryTrendArray,
      lines: [
        {
          name: '个数',
          color: '#98ff1a',
          dataKey: 'value',
        },
      ],
    };
    const recentVersionDensityObj = {
      style: { width: '100%', height: '200px' },
      data: formdata.recentVersionDensityArray,
      areas: [
        {
          name: '个数',
          color: '#87CE97',
          dataKey: 'value',
        },
      ],
    };
    const workLoadObj = {
      style: { width: '100%', height: '200px' },
      data: formdata.workLoadArray,
      options: {
        barColor: '#87ce97',
        barName: 'sprint任务量/sprint周期',
      },
    };

    // const workLoadObj = {
    //   style: { width: '100%', height: '140px' },
    //   data: formdata.workLoadArray,
    //   lines: [
    //     {
    //       name: '能效值',
    //       color: '#98ff1a',
    //       dataKey: 'value',
    //     },
    //   ],
    // };
    const priorityBugObj = {
      style: { width: '100%', height: '200px' },
      data: formdata.priorityBugArray,
    };
    const resonBugObj = {
      style: { width: '100%', height: '200px' },
      data: formdata.reasonBugArray,
    };
    // 定义表头字段及取值内容,比例按总量1000来分
    const storycolumns = [
      {
        title: 'jiraID',
        dataIndex: 'jira_id',
        key: 'jira_id',
        width: 100,
      },
      {
        title: '描述',
        dataIndex: 'summary',
        key: 'summary',
        width: 500,
      },
      {
        title: '责任人',
        dataIndex: 'assignee',
        key: 'assignee',
        width: 100,
      },
      {
        title: '版本号',
        dataIndex: 'jira_fixversion',
        key: 'jira_fixversion',
        width: 200,
      },
      {
        title: 'reporter',
        dataIndex: 'reporter',
        key: 'reporter',
        width: 100,
      },
    ];
    const jiracolums = [
      {
        title: 'jiraID',
        dataIndex: 'jira_id',
        key: 'jira_id',
        width: 100,
      },
      {
        title: '描述',
        dataIndex: 'summary',
        key: 'summary',
        width: 600,
      },
      {
        title: '责任人',
        dataIndex: 'assignee',
        key: 'assignee',
        width: 100,
      },
      {
        title: '版本号',
        dataIndex: 'jira_fixversion',
        key: 'jira_fixversion',
        width: 100,
      },
      {
        title: 'reporter',
        dataIndex: 'reporter',
        key: 'reporter',
        width: 100,
      },
    ];
    return (
      <div>
        <Row>
          <div className={styles.btnGroup}>
            <Button type="primary" icon="left" onClick={this.handleCancel}>返回</Button>
          </div>
        </Row>
        <Row gutter={16} style={{ marginBottom: 16 }}>
          <Form layout="inline">
            <Col span={6}>
              <FormItem label="项目名称" {...formItemLayout1} >
                {getFieldDecorator('project_name', {
                  initialValue: currentUser.project_name||"",
                  rules: [{
                    required: true,
                    message: '请填写项目名称',
                  }],
                })(
                  <Select
                    showSearch
                    optionFilterProp="children"
                    disabled={ButtonVisible}
                    filterOption={(input, option) =>
                      option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                  >
                    <Option key={-1} value="">请选择</Option>
                    {// 这括号表示括起来的是一个表达式 不同于函数的括号，这里面只能放一个表达式
                      ProjectList.map((item, index) => {
                        return (<Option key={index} value={item}>{item}</Option>);
                      })
                    }
                  </Select>
                )}
              </FormItem>
            </Col>
            <Col span={6}>
              <FormItem label="版本号" {...formItemLayout1} >
                {getFieldDecorator('fix_version', {
                  initialValue: currentUser.fix_version||"",
                  rules: [{
                    required: true,
                    message: '请填写版本号',
                  }],
                })(
                  // onKeyDown={(e)=>this.onKeyDown(e)}
                  <Input disabled={ButtonVisible} />
                )}
              </FormItem>
            </Col>
            <Col span={6}>
              <FormItem label="" {...formItemLayout} >
              <Button
                  type="primary"
                  loading={loading}
                  onClick={this.handleSearch}
                  disabled={ButtonVisible}
                >
                  查询
                </Button>
              </FormItem>
            </Col>
          </Form>
        </Row>       
        <Row style={{ marginBottom: 1,marginTop: 60 }}>
          <Table
            columns={jiracolums}
            dataSource={formdata.Hotfix}
            title={() => <div style={{ fontSize: 16, fontWeight: 500 }}>{'近一个月的Hotfix'}</div>}
            loading={loading}
            rowKey={record => record.id}
            bordered
            scroll={{ y: 240 }}
            pagination={{
              pageSize: DEFAULT_PAGE_SIZE,
            }}
          />
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Col span={24}>
            <FormItem label="hotfix分析" {...formItemLayout2} >
              {getFieldDecorator('hotfix_analysis', {
                initialValue: currentUser.hotfix_analysis||"",
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12}>
            <Card loading={loading} title="近6个sprint插入需求趋势">
              <MyLineChart {...insertStoryTrendObj} />
            </Card>
          </Col>
          <Col span={12}>
            <Card loading={loading} title="近6个sprint延期需求趋势">
              <MyLineChart {...delayStoryTrendObj} />
            </Card>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Table
            columns={storycolumns}
            dataSource={formdata.insStoryDetail}
            title={() => <div style={{ fontSize: 16, fontWeight: 500 }}>{'最近一个sprint插入需求详情'}</div>}
            loading={loading}
            rowKey={record => record.id}
            bordered
            scroll={{ y: 240 }}
            pagination={{
              pageSize: DEFAULT_PAGE_SIZE,
            }}
          />
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Table
            columns={storycolumns}
            dataSource={formdata.delayStoryDetail}
            title={() => <div style={{ fontSize: 16, fontWeight: 500 }}>{'最近一个sprint延期需求详情'}</div>}
            loading={loading}
            rowKey={record => record.id}
            bordered
            scroll={{ y: 240 }}
            pagination={{
              pageSize: DEFAULT_PAGE_SIZE,
            }}
          />
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Col span={24}>
            <FormItem label="需求趋势分析" {...formItemLayout2} >
              {getFieldDecorator('strend_analysis', {
                initialValue: currentUser.strend_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12}>
            <Card loading={loading} title="近6个版本的BUG密度趋势">
              <MyAreaChart {...recentVersionDensityObj} />
            </Card>
          </Col>
          <Col span={12}>
            <Card loading={loading} title="近6个sprint的效率值">
              <HorizontalBarChart {...workLoadObj} />
            </Card>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12} >
            <FormItem label="BUG密度分析" {...formItemLayout1} >
              {getFieldDecorator('bugdensity_analysis', {
                initialValue: currentUser.bugdensity_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
          <Col span={12} >
            <FormItem label="项目效率趋势分析" {...formItemLayout1} >
              {getFieldDecorator('workload_analysis', {
                initialValue: currentUser.workload_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12}>
            <Card loading={loading} title="个人BUG密度趋势">
              <LineEchart {...LineEchartObj} />
            </Card>
          </Col>
          <Col span={12}>
            <Card loading={loading} title="个人工作量统计">
              <StackBarEchart {...StackBarEchartObj} />
            </Card>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12} >
            <FormItem label="个人BUG密度分析" {...formItemLayout1} >
              {getFieldDecorator('devbugdensity_analysis', {
                initialValue: currentUser.devbugdensity_analysis|| [],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
          <Col span={12} >
            <FormItem label="个人工作量分析" {...formItemLayout1} >
              {getFieldDecorator('devworkload_analysis', {
                initialValue: currentUser.devworkload_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Table
            columns={jiracolums}
            dataSource={formdata.longTimeBugArray}
            title={() => <div style={{ fontSize: 16, fontWeight: 500 }}>{'本版本超过1天未解决的P0bug'}</div>}
            loading={loading}
            rowKey={record => record.id}
            bordered
            scroll={{ y: 240 }}
            pagination={{
              pageSize: DEFAULT_PAGE_SIZE,
            }}
          />
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Col >
            <FormItem label="P0解决时效分析" {...formItemLayout1} >
              {getFieldDecorator('p0resltime_analysis', {
                initialValue: currentUser.p0resltime_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Table
            columns={jiracolums}
            dataSource={formdata.reoenBug}
            title={() => <div style={{ fontSize: 16, fontWeight: 500 }}>{'本版本reopen的bug'}</div>}
            loading={loading}
            rowKey={record => record.id}
            bordered
            scroll={{ y: 240 }}
            pagination={{
              pageSize: DEFAULT_PAGE_SIZE,
            }}
          />
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Col >
            <FormItem label="reopen bug分析" {...formItemLayout1} >
              {getFieldDecorator('reopen_analysis', {
                initialValue: currentUser.reopen_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12}>
            <Card loading={loading} title="本版本的BUG优先级占比">
              <MyPieChart {...priorityBugObj} />
            </Card>
          </Col>
          <Col span={12}>
            <Card loading={loading} title="本版本的BUG原因占比">
              <MyPieChart {...resonBugObj} />
            </Card>
          </Col>
        </Row>
        <Row gutter={24} style={{ marginBottom: 16 }}>
          <Col span={12}>
            <FormItem label="优先级占比分析" {...formItemLayout1} >
              {getFieldDecorator('priority_analysis', {
                initialValue: currentUser.priority_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
          <Col span={12}>
            <FormItem label="原因占比分析" {...formItemLayout1} >
              {getFieldDecorator('reason_analysis', {
                initialValue: currentUser.reason_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Table
            columns={jiracolums}
            dataSource={formdata.inprogressActionArray}
            title={() => <div style={{ fontSize: 16, fontWeight: 500 }}>{'进行中的改进action'}</div>}
            loading={loading}
            rowKey={record => record.id}
            bordered
            scroll={{ y: 240 }}
            pagination={{
              pageSize: DEFAULT_PAGE_SIZE,
            }}
          />
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Col >
            <FormItem label="改进action分析" {...formItemLayout1} >
              {getFieldDecorator('action_analysis', {
                initialValue: currentUser.action_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Card loading={loading} title="JIRA规范(近一周的数据)">
            <Collapse defaultActiveKey={['1']}>
              <Panel header="缺COMMENT的BUG" key="1">
                <Table
                  columns= {jiracolums}
                  dataSource={formdata.WrongJiraArray}
                  loading={loading}
                  rowKey={record => record.id}
                  bordered
                  scroll={{ y: 240 }}
                  pagination={{
                    pageSize: DEFAULT_PAGE_SIZE,
                  }}
                />
              </Panel>
              {/* <Panel header="缺DESCRIPTION的STORY" key="2">
                <Table
                  columns={lostDescArray && lostDescArray.length > 0 ? jiracolums : []}
                  dataSource={lostDescArray}
                  loading={loading}
                  rowKey={record => record.id}
                  bordered
                  scroll={{ y: 240 }}
                  pagination={{
                    pageSize: DEFAULT_PAGE_SIZE,
                  }}
                />
              </Panel>
              <Panel header="缺FIXVERSION的JIRA" key="3" >
                <Table
                  columns={lostverArray && lostverArray.length > 0 ? jiracolums : []}
                  dataSource={lostverArray}
                  loading={loading}
                  rowKey={record => record.id}
                  bordered
                  scroll={{ y: 240 }}
                  pagination={{
                    pageSize: DEFAULT_PAGE_SIZE,
                  }}
                />
              </Panel>
              <Panel header="缺SPRINT的JIRA" key="4" >
                <Table
                  columns={lostsprintArray && lostsprintArray.length > 0 ? jiracolums : []}
                  dataSource={lostsprintArray}
                  loading={loading}
                  rowKey={record => record.id}
                  bordered
                  scroll={{ y: 240 }}
                  pagination={{
                    pageSize: DEFAULT_PAGE_SIZE,
                  }}
                />
              </Panel> */}
            </Collapse>
          </Card>
        </Row>
        <Row style={{ marginBottom: 16 }}>
          <Col >
            <FormItem label="jira规范分析" {...formItemLayout1} >
              {getFieldDecorator('jiranorm_analysis', {
                initialValue: currentUser.jiranorm_analysis||[],
              })(
                <Input />
              )}
            </FormItem>
          </Col>
        </Row>
        <Row gutter={12} style={{ marginBottom: 8 }}>
          <div className={styles.btnGroup}>
            <Button
              type="primary"
              loading={loading}
              onClick={this.handleOk}
            >
              保存
            </Button>
            <Button type="primary" style={{ margin: 8 }} onClick={this.handleCancel}>取消</Button>
            <Button type="primary" onClick={this.handleSaveandSend}>保存并发送邮件</Button>
          </div>
        </Row>
      </div>
    );
  }
}

